// 获取图形验证码
import request from '@/utils/request.js'
export const getCaptcha = () => {
  return request.get('/captcha/image')
}

// 获取短信验证码
export const getMsgCode = (captchaCode, captchaToken, phoneNum) => {
  return request.post('/captcha/sendMsgCaptcha', {
    captchaCode,
    captchaToken,
    phoneNum
  })
}

// 登录
export const login = (phoneNum, msgCode, phoneToken) => {
  return request.post('/user/userLogin', {
    phoneNum, msgCode, phoneToken
  })
}

export const isLogin = (token) => {
  return request.get('/user/isLogin', {
    params: {
      token
    }
  })
}
